package logic;

import java.net.NetworkInterface;
import java.util.Enumeration;

public class Network {
	public static void main(String[] args) {
		try {
			Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
			while (networkInterfaces.hasMoreElements()) {
				NetworkInterface networkInterface = (NetworkInterface) networkInterfaces.nextElement();
				System.out.println(networkInterface.getName() + ": "
						+ networkInterface.getInetAddresses().nextElement());
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
